#ifndef GRAPHIC_COMPONENTS
#define GRAPHIC_COMPONENTS

#include "Base/Component.h"
#include "Model.h"
#include <SFML/Graphics.hpp>

class GraphicComponent : public BPL::Component
{
public:
	enum {HUD,FIRST,SECOND,THIRD};
	enum {NORMAL, MODEL, TEXT};

	GraphicComponent () : imageType(NORMAL), layer(SECOND) {}
    static const int familyId = 2;

    sf::Drawable* m_sprite;
	sf::Transformable m_transform;
    int layer;
	int imageType;

	virtual ~GraphicComponent()
	{
		if(imageType == NORMAL)
		{
			if(m_sprite != NULL)
			{
				delete m_sprite;
				m_sprite = NULL;
			}
		}
	}
};

typedef boost::shared_ptr<GraphicComponent> GraphicComponentPtr;

class ModelGraphicComponent : public GraphicComponent
{
public:
	ModelGraphicComponent () : GraphicComponent() {imageType = MODEL;}
    static const int familyId = 2;

    Model model;
};

typedef boost::shared_ptr<ModelGraphicComponent> ModelGraphicComponentPtr;

class TextGraphicComponent : public GraphicComponent
{
public:
	TextGraphicComponent () : GraphicComponent() {imageType = TEXT;layer = HUD;}
    static const int familyId = 2;

	sf::Text text;
};

typedef boost::shared_ptr<TextGraphicComponent> TextGraphicComponentPtr;



#endif
